<?xml version="1.0" encoding="UTF-8" ?>
<ui:composition template="/store/layout/main.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core">

	<ui:define name="title">
        Chocolor:Store Order Home
    </ui:define>

	<ui:define name="content">
		<ui:include src="/global/gadgets/loginRequired.xhtml" />

		<c:if test="#{loginBean.isAuthenticated()}">
			<p:panelGrid style="margin-top:20px; width:100%; border-style:hidden"
				id="orderAddForm">
				<f:facet name="header">
					<p:row>
						<p:column style="border-style:hidden" colspan="2">Your order: </p:column>
					</p:row>
				</f:facet>

				<p:row>
					<p:column style="width:200px; border-style:hidden">Client:</p:column>
					<p:column style="border-style:hidden">#{orderAdd.orderDraft.client.clientId}</p:column>
					<p:column
						style="width:10%; border-style:hidden; background-color:white"></p:column>
				</p:row>

				<p:row>
					<p:column style="border-style:hidden">Order date:</p:column>
					<p:column style="border-style:hidden">#{orderAdd.orderDraft.orderDraftDate}</p:column>

				</p:row>

				<p:row>
					<p:column style="border-style:hidden">Plate article:</p:column>
					<p:column style="border-style:hidden">#{orderAdd.orderDraft.plateArticle.articleId}	</p:column>
				</p:row>

				<p:row>
					<p:column style="border-style:hidden">Logotype: </p:column>
					<p:column style="border-style:hidden">
						<h:form>
							<p:commandLink value="#{orderAdd.orderDraft.logotype.fileName}"
								ajax="false" immediate="true">
								<p:fileDownload value="#{orderAdd.getBufferDownloadFile()}" />
							</p:commandLink>
						</h:form>
					</p:column>

				</p:row>

				<p:row>
					<p:column style="border-style:hidden">Inscription: </p:column>
					<p:column style="border-style:hidden">#{orderAdd.orderDraft.inscription}
				</p:column>

				</p:row>

				<p:row>
					<p:column style="border-style:hidden">Frame: </p:column>
					<p:column style="border-style:hidden">#{orderAdd.orderDraft.hasFrame}
				</p:column>

				</p:row>

				<p:row>
					<p:column style="border-style:hidden">Chocolate type: </p:column>
					<p:column style="border-style:hidden">#{orderAdd.orderDraft.chocolateType.rawType}
				</p:column>

				</p:row>

				<p:row>
					<p:column style="border-style:hidden">Packing: </p:column>
					<p:column style="border-style:hidden">#{orderAdd.orderDraft.platePacking.packingType}
				</p:column>

				</p:row>

				<p:row>
					<p:column style="border-style:hidden">Logo colour: </p:column>
					<p:column style="border-style:hidden">#{orderAdd.orderDraft.logoColor.chocolateColor}
				</p:column>

				</p:row>

				<p:row>
					<p:column style="border-style:hidden">Inscription colour: </p:column>
					<p:column style="border-style:hidden">#{orderAdd.orderDraft.inscriptionColor.chocolateColor}
				</p:column>

				</p:row>
				<p:row>
					<p:column style="border-style:hidden">Plato colour: </p:column>
					<p:column style="border-style:hidden">#{orderAdd.orderDraft.plateColor.chocolateColor}
					</p:column>
				</p:row>

				<p:row>
					<p:column style="border-style:hidden">Body colour: </p:column>
					<p:column style="border-style:hidden">#{orderAdd.orderDraft.bodyColor.chocolateColor}
					</p:column>

				</p:row>


				<p:row>
					<p:column style="border-style:hidden">Quantity: </p:column>
					<p:column style="border-style:hidden">#{orderAdd.orderDraft.quantity}
					</p:column>

				</p:row>

				<f:facet name="footer">
					<p:row>
						<p:column style="text-align:left; border-style:hidden" colspan="2">
							<h:form>
								<p:commandButton value="Confirm order" id="orderAdd"
									ajax="false" action="#{orderAdd.orderAdd()}"
									icon="ui-icon-check" />
								<p:commandButton value="Back" id="return" disabled="false"
									ajax="false" action="backToOrderAdd" />
							</h:form>
						</p:column>
					</p:row>

				</f:facet>
			</p:panelGrid>
		</c:if>

	</ui:define>


</ui:composition>
